home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / pref / nsIPref.h next >
C/C++ Source or Header  |  2006-05-08  |  32KB  |  679 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIPref.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIPref_h__
  6. #define __gen_nsIPref_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. #ifndef __gen_nsIPrefService_h__
  14. #include "nsIPrefService.h"
  15. #endif
  16.  
  17. #ifndef __gen_nsIPrefBranch_h__
  18. #include "nsIPrefBranch.h"
  19. #endif
  20.  
  21. /* For IDL files that don't want to include root IDL files. */
  22. #ifndef NS_NO_VTABLE
  23. #define NS_NO_VTABLE
  24. #endif
  25. class nsILocalFile; /* forward declaration */
  26.  
  27. class nsIObserver; /* forward declaration */
  28.  
  29. class nsIFileSpec; /* forward declaration */
  30.  
  31. #ifndef have_PrefChangedFunc_typedef
  32. typedef int (*PR_CALLBACK PrefChangedFunc)(const char *, void *);
  33. #define have_PrefChangedFunc_typedef
  34. #endif
  35. typedef void (*PrefEnumerationFunc)(const char *, void *);
  36. #define NS_PREF_CID                                    \
  37.   { /* {dc26e0e0-ca94-11d1-a9a4-00805f8a7ac4} */       \
  38.     0xdc26e0e0,                                        \
  39.     0xca94,                                            \
  40.     0x11d1,                                            \
  41.     { 0xa9, 0xa4, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xc4 } \
  42.   }
  43. #define NS_PREF_CONTRACTID \
  44.   "@mozilla.org/preferences;1" 
  45. #define NS_PREF_CLASSNAME "Preferences Service"
  46.  
  47. #define NS_PREF_VALUE_CHANGED 1 
  48.  
  49. /* starting interface:    nsIPref */
  50. #define NS_IPREF_IID_STR "a22ad7b0-ca86-11d1-a9a4-00805f8a7ac4"
  51.  
  52. #define NS_IPREF_IID \
  53.   {0xa22ad7b0, 0xca86, 0x11d1, \
  54.     { 0xa9, 0xa4, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xc4 }}
  55.  
  56. class NS_NO_VTABLE nsIPref : public nsISupports {
  57.  public: 
  58.  
  59.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPREF_IID)
  60.  
  61.   /* void readUserPrefs (in nsIFile aFile); */
  62.   NS_IMETHOD ReadUserPrefs(nsIFile *aFile) = 0;
  63.  
  64.   /* void ResetPrefs (); */
  65.   NS_IMETHOD ResetPrefs(void) = 0;
  66.  
  67.   /* void ResetUserPrefs (); */
  68.   NS_IMETHOD ResetUserPrefs(void) = 0;
  69.  
  70.   /* void savePrefFile (in nsIFile aFile); */
  71.   NS_IMETHOD SavePrefFile(nsIFile *aFile) = 0;
  72.  
  73.   /* nsIPrefBranch getBranch (in string aPrefRoot); */
  74.   NS_IMETHOD GetBranch(const char *aPrefRoot, nsIPrefBranch **_retval) = 0;
  75.  
  76.   /* nsIPrefBranch getDefaultBranch (in string aPrefRoot); */
  77.   NS_IMETHOD GetDefaultBranch(const char *aPrefRoot, nsIPrefBranch **_retval) = 0;
  78.  
  79.   enum { ePrefInvalid = 0 };
  80.  
  81.   enum { ePrefLocked = 1 };
  82.  
  83.   enum { ePrefUserset = 2 };
  84.  
  85.   enum { ePrefConfig = 4 };
  86.  
  87.   enum { ePrefRemote = 8 };
  88.  
  89.   enum { ePrefLilocal = 16 };
  90.  
  91.   enum { ePrefString = 32 };
  92.  
  93.   enum { ePrefInt = 64 };
  94.  
  95.   enum { ePrefBool = 128 };
  96.  
  97.   enum { ePrefValuetypeMask = 224 };
  98.  
  99.   /* readonly attribute string root; */
  100.   NS_IMETHOD GetRoot(char * *aRoot) = 0;
  101.  
  102.   /* long GetPrefType (in string aPrefName); */
  103.   NS_IMETHOD GetPrefType(const char *aPrefName, PRInt32 *_retval) = 0;
  104.  
  105.   /* boolean GetBoolPref (in string aPrefName); */
  106.   NS_IMETHOD GetBoolPref(const char *aPrefName, PRBool *_retval) = 0;
  107.  
  108.   /* void SetBoolPref (in string aPrefName, in long aValue); */
  109.   NS_IMETHOD SetBoolPref(const char *aPrefName, PRInt32 aValue) = 0;
  110.  
  111.   /* string GetCharPref (in string aPrefName); */
  112.   NS_IMETHOD GetCharPref(const char *aPrefName, char **_retval) = 0;
  113.  
  114.   /* void SetCharPref (in string aPrefName, in string aValue); */
  115.   NS_IMETHOD SetCharPref(const char *aPrefName, const char *aValue) = 0;
  116.  
  117.   /* long GetIntPref (in string aPrefName); */
  118.   NS_IMETHOD GetIntPref(const char *aPrefName, PRInt32 *_retval) = 0;
  119.  
  120.   /* void SetIntPref (in string aPrefName, in long aValue); */
  121.   NS_IMETHOD SetIntPref(const char *aPrefName, PRInt32 aValue) = 0;
  122.  
  123.   /* void getComplexValue (in string aPrefName, in nsIIDRef aType, [iid_is (aType), retval] out nsQIResult aValue); */
  124.   NS_IMETHOD GetComplexValue(const char *aPrefName, const nsIID & aType, void * *aValue) = 0;
  125.  
  126.   /* void setComplexValue (in string aPrefName, in nsIIDRef aType, in nsISupports aValue); */
  127.   NS_IMETHOD SetComplexValue(const char *aPrefName, const nsIID & aType, nsISupports *aValue) = 0;
  128.  
  129.   /* void ClearUserPref (in string aPrefName); */
  130.   NS_IMETHOD ClearUserPref(const char *aPrefName) = 0;
  131.  
  132.   /* boolean PrefIsLocked (in string aPrefName); */
  133.   NS_IMETHOD PrefIsLocked(const char *aPrefName, PRBool *_retval) = 0;
  134.  
  135.   /* void lockPref (in string aPrefName); */
  136.   NS_IMETHOD LockPref(const char *aPrefName) = 0;
  137.  
  138.   /* void unlockPref (in string aPrefName); */
  139.   NS_IMETHOD UnlockPref(const char *aPrefName) = 0;
  140.  
  141.   /* void resetBranch (in string aStartingAt); */
  142.   NS_IMETHOD ResetBranch(const char *aStartingAt) = 0;
  143.  
  144.   /* void DeleteBranch (in string aStartingAt); */
  145.   NS_IMETHOD DeleteBranch(const char *aStartingAt) = 0;
  146.  
  147.   /* void getChildList (in string aStartingAt, out unsigned long aCount, [array, size_is (aCount), retval] out string aChildArray); */
  148.   NS_IMETHOD GetChildList(const char *aStartingAt, PRUint32 *aCount, char ***aChildArray) = 0;
  149.  
  150.   /* void addObserver (in string aDomain, in nsIObserver aObserver, in boolean aHoldWeak); */
  151.   NS_IMETHOD AddObserver(const char *aDomain, nsIObserver *aObserver, PRBool aHoldWeak) = 0;
  152.  
  153.   /* void removeObserver (in string aDomain, in nsIObserver aObserver); */
  154.   NS_IMETHOD RemoveObserver(const char *aDomain, nsIObserver *aObserver) = 0;
  155.  
  156.   /* string CopyCharPref (in string pref); */
  157.   NS_IMETHOD CopyCharPref(const char *pref, char **_retval) = 0;
  158.  
  159.   /* string CopyDefaultCharPref (in string pref); */
  160.   NS_IMETHOD CopyDefaultCharPref(const char *pref, char **_retval) = 0;
  161.  
  162.   /* boolean GetDefaultBoolPref (in string pref); */
  163.   NS_IMETHOD GetDefaultBoolPref(const char *pref, PRBool *_retval) = 0;
  164.  
  165.   /* long GetDefaultIntPref (in string pref); */
  166.   NS_IMETHOD GetDefaultIntPref(const char *pref, PRInt32 *_retval) = 0;
  167.  
  168.   /* void SetDefaultBoolPref (in string pref, in boolean value); */
  169.   NS_IMETHOD SetDefaultBoolPref(const char *pref, PRBool value) = 0;
  170.  
  171.   /* void SetDefaultCharPref (in string pref, in string value); */
  172.   NS_IMETHOD SetDefaultCharPref(const char *pref, const char *value) = 0;
  173.  
  174.   /* void SetDefaultIntPref (in string pref, in long value); */
  175.   NS_IMETHOD SetDefaultIntPref(const char *pref, PRInt32 value) = 0;
  176.  
  177.   /* wstring CopyUnicharPref (in string pref); */
  178.   NS_IMETHOD CopyUnicharPref(const char *pref, PRUnichar **_retval) = 0;
  179.  
  180.   /* wstring CopyDefaultUnicharPref (in string pref); */
  181.   NS_IMETHOD CopyDefaultUnicharPref(const char *pref, PRUnichar **_retval) = 0;
  182.  
  183.   /* void SetUnicharPref (in string pref, in wstring value); */
  184.   NS_IMETHOD SetUnicharPref(const char *pref, const PRUnichar *value) = 0;
  185.  
  186.   /* void SetDefaultUnicharPref (in string pref, in wstring value); */
  187.   NS_IMETHOD SetDefaultUnicharPref(const char *pref, const PRUnichar *value) = 0;
  188.  
  189.   /* wstring getLocalizedUnicharPref (in string pref); */
  190.   NS_IMETHOD GetLocalizedUnicharPref(const char *pref, PRUnichar **_retval) = 0;
  191.  
  192.   /* wstring getDefaultLocalizedUnicharPref (in string pref); */
  193.   NS_IMETHOD GetDefaultLocalizedUnicharPref(const char *pref, PRUnichar **_retval) = 0;
  194.  
  195.   /* nsIFileSpec GetFilePref (in string pref); */
  196.   NS_IMETHOD GetFilePref(const char *pref, nsIFileSpec **_retval) = 0;
  197.  
  198.   /* void SetFilePref (in string pref, in nsIFileSpec value, in boolean setDefault); */
  199.   NS_IMETHOD SetFilePref(const char *pref, nsIFileSpec *value, PRBool setDefault) = 0;
  200.  
  201.   /* nsILocalFile getFileXPref (in string pref); */
  202.   NS_IMETHOD GetFileXPref(const char *pref, nsILocalFile **_retval) = 0;
  203.  
  204.   /* void setFileXPref (in string pref, in nsILocalFile value); */
  205.   NS_IMETHOD SetFileXPref(const char *pref, nsILocalFile *value) = 0;
  206.  
  207.   /* [noscript] void RegisterCallback (in string domain, in PrefChangedFunc callback, in voidPtr closure); */
  208.   NS_IMETHOD RegisterCallback(const char *domain, PrefChangedFunc callback, void * closure) = 0;
  209.  
  210.   /* [noscript] void UnregisterCallback (in string domain, in PrefChangedFunc callback, in voidPtr closure); */
  211.   NS_IMETHOD UnregisterCallback(const char *domain, PrefChangedFunc callback, void * closure) = 0;
  212.  
  213.   /**
  214.    * EnumerateChildren
  215.    *
  216.    * Call back function "callback" with every preference string
  217.    * having prefix "parent". Pass "data" to "callback" when calling.
  218.    * 
  219.    * @param parent A string representation of a prefix of preferences
  220.    * @param callback A function to call back for each matching preference
  221.    * @param data A piece of data to pass on to the callback
  222.    */
  223.   /* [noscript] void EnumerateChildren (in string parent, in PrefEnumerationFunc callback, in voidPtr data); */
  224.   NS_IMETHOD EnumerateChildren(const char *parent, PrefEnumerationFunc callback, void * data) = 0;
  225.  
  226. };
  227.  
  228. /* Use this macro when declaring classes that implement this interface. */
  229. #define NS_DECL_NSIPREF \
  230.   NS_IMETHOD ReadUserPrefs(nsIFile *aFile); \
  231.   NS_IMETHOD ResetPrefs(void); \
  232.   NS_IMETHOD ResetUserPrefs(void); \
  233.   NS_IMETHOD SavePrefFile(nsIFile *aFile); \
  234.   NS_IMETHOD GetBranch(const char *aPrefRoot, nsIPrefBranch **_retval); \
  235.   NS_IMETHOD GetDefaultBranch(const char *aPrefRoot, nsIPrefBranch **_retval); \
  236.   NS_IMETHOD GetRoot(char * *aRoot); \
  237.   NS_IMETHOD GetPrefType(const char *aPrefName, PRInt32 *_retval); \
  238.   NS_IMETHOD GetBoolPref(const char *aPrefName, PRBool *_retval); \
  239.   NS_IMETHOD SetBoolPref(const char *aPrefName, PRInt32 aValue); \
  240.   NS_IMETHOD GetCharPref(const char *aPrefName, char **_retval); \
  241.   NS_IMETHOD SetCharPref(const char *aPrefName, const char *aValue); \
  242.   NS_IMETHOD GetIntPref(const char *aPrefName, PRInt32 *_retval); \
  243.   NS_IMETHOD SetIntPref(const char *aPrefName, PRInt32 aValue); \
  244.   NS_IMETHOD GetComplexValue(const char *aPrefName, const nsIID & aType, void * *aValue); \
  245.   NS_IMETHOD SetComplexValue(const char *aPrefName, const nsIID & aType, nsISupports *aValue); \
  246.   NS_IMETHOD ClearUserPref(const char *aPrefName); \
  247.   NS_IMETHOD PrefIsLocked(const char *aPrefName, PRBool *_retval); \
  248.   NS_IMETHOD LockPref(const char *aPrefName); \
  249.   NS_IMETHOD UnlockPref(const char *aPrefName); \
  250.   NS_IMETHOD ResetBranch(const char *aStartingAt); \
  251.   NS_IMETHOD DeleteBranch(const char *aStartingAt); \
  252.   NS_IMETHOD GetChildList(const char *aStartingAt, PRUint32 *aCount, char ***aChildArray); \
  253.   NS_IMETHOD AddObserver(const char *aDomain, nsIObserver *aObserver, PRBool aHoldWeak); \
  254.   NS_IMETHOD RemoveObserver(const char *aDomain, nsIObserver *aObserver); \
  255.   NS_IMETHOD CopyCharPref(const char *pref, char **_retval); \
  256.   NS_IMETHOD CopyDefaultCharPref(const char *pref, char **_retval); \
  257.   NS_IMETHOD GetDefaultBoolPref(const char *pref, PRBool *_retval); \
  258.   NS_IMETHOD GetDefaultIntPref(const char *pref, PRInt32 *_retval); \
  259.   NS_IMETHOD SetDefaultBoolPref(const char *pref, PRBool value); \
  260.   NS_IMETHOD SetDefaultCharPref(const char *pref, const char *value); \
  261.   NS_IMETHOD SetDefaultIntPref(const char *pref, PRInt32 value); \
  262.   NS_IMETHOD CopyUnicharPref(const char *pref, PRUnichar **_retval); \
  263.   NS_IMETHOD CopyDefaultUnicharPref(const char *pref, PRUnichar **_retval); \
  264.   NS_IMETHOD SetUnicharPref(const char *pref, const PRUnichar *value); \
  265.   NS_IMETHOD SetDefaultUnicharPref(const char *pref, const PRUnichar *value); \
  266.   NS_IMETHOD GetLocalizedUnicharPref(const char *pref, PRUnichar **_retval); \
  267.   NS_IMETHOD GetDefaultLocalizedUnicharPref(const char *pref, PRUnichar **_retval); \
  268.   NS_IMETHOD GetFilePref(const char *pref, nsIFileSpec **_retval); \
  269.   NS_IMETHOD SetFilePref(const char *pref, nsIFileSpec *value, PRBool setDefault); \
  270.   NS_IMETHOD GetFileXPref(const char *pref, nsILocalFile **_retval); \
  271.   NS_IMETHOD SetFileXPref(const char *pref, nsILocalFile *value); \
  272.   NS_IMETHOD RegisterCallback(const char *domain, PrefChangedFunc callback, void * closure); \
  273.   NS_IMETHOD UnregisterCallback(const char *domain, PrefChangedFunc callback, void * closure); \
  274.   NS_IMETHOD EnumerateChildren(const char *parent, PrefEnumerationFunc callback, void * data); 
  275.  
  276. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  277. #define NS_FORWARD_NSIPREF(_to) \
  278.   NS_IMETHOD ReadUserPrefs(nsIFile *aFile) { return _to ReadUserPrefs(aFile); } \
  279.   NS_IMETHOD ResetPrefs(void) { return _to ResetPrefs(); } \
  280.   NS_IMETHOD ResetUserPrefs(void) { return _to ResetUserPrefs(); } \
  281.   NS_IMETHOD SavePrefFile(nsIFile *aFile) { return _to SavePrefFile(aFile); } \
  282.   NS_IMETHOD GetBranch(const char *aPrefRoot, nsIPrefBranch **_retval) { return _to GetBranch(aPrefRoot, _retval); } \
  283.   NS_IMETHOD GetDefaultBranch(const char *aPrefRoot, nsIPrefBranch **_retval) { return _to GetDefaultBranch(aPrefRoot, _retval); } \
  284.   NS_IMETHOD GetRoot(char * *aRoot) { return _to GetRoot(aRoot); } \
  285.   NS_IMETHOD GetPrefType(const char *aPrefName, PRInt32 *_retval) { return _to GetPrefType(aPrefName, _retval); } \
  286.   NS_IMETHOD GetBoolPref(const char *aPrefName, PRBool *_retval) { return _to GetBoolPref(aPrefName, _retval); } \
  287.   NS_IMETHOD SetBoolPref(const char *aPrefName, PRInt32 aValue) { return _to SetBoolPref(aPrefName, aValue); } \
  288.   NS_IMETHOD GetCharPref(const char *aPrefName, char **_retval) { return _to GetCharPref(aPrefName, _retval); } \
  289.   NS_IMETHOD SetCharPref(const char *aPrefName, const char *aValue) { return _to SetCharPref(aPrefName, aValue); } \
  290.   NS_IMETHOD GetIntPref(const char *aPrefName, PRInt32 *_retval) { return _to GetIntPref(aPrefName, _retval); } \
  291.   NS_IMETHOD SetIntPref(const char *aPrefName, PRInt32 aValue) { return _to SetIntPref(aPrefName, aValue); } \
  292.   NS_IMETHOD GetComplexValue(const char *aPrefName, const nsIID & aType, void * *aValue) { return _to GetComplexValue(aPrefName, aType, aValue); } \
  293.   NS_IMETHOD SetComplexValue(const char *aPrefName, const nsIID & aType, nsISupports *aValue) { return _to SetComplexValue(aPrefName, aType, aValue); } \
  294.   NS_IMETHOD ClearUserPref(const char *aPrefName) { return _to ClearUserPref(aPrefName); } \
  295.   NS_IMETHOD PrefIsLocked(const char *aPrefName, PRBool *_retval) { return _to PrefIsLocked(aPrefName, _retval); } \
  296.   NS_IMETHOD LockPref(const char *aPrefName) { return _to LockPref(aPrefName); } \
  297.   NS_IMETHOD UnlockPref(const char *aPrefName) { return _to UnlockPref(aPrefName); } \
  298.   NS_IMETHOD ResetBranch(const char *aStartingAt) { return _to ResetBranch(aStartingAt); } \
  299.   NS_IMETHOD DeleteBranch(const char *aStartingAt) { return _to DeleteBranch(aStartingAt); } \
  300.   NS_IMETHOD GetChildList(const char *aStartingAt, PRUint32 *aCount, char ***aChildArray) { return _to GetChildList(aStartingAt, aCount, aChildArray); } \
  301.   NS_IMETHOD AddObserver(const char *aDomain, nsIObserver *aObserver, PRBool aHoldWeak) { return _to AddObserver(aDomain, aObserver, aHoldWeak); } \
  302.   NS_IMETHOD RemoveObserver(const char *aDomain, nsIObserver *aObserver) { return _to RemoveObserver(aDomain, aObserver); } \
  303.   NS_IMETHOD CopyCharPref(const char *pref, char **_retval) { return _to CopyCharPref(pref, _retval); } \
  304.   NS_IMETHOD CopyDefaultCharPref(const char *pref, char **_retval) { return _to CopyDefaultCharPref(pref, _retval); } \
  305.   NS_IMETHOD GetDefaultBoolPref(const char *pref, PRBool *_retval) { return _to GetDefaultBoolPref(pref, _retval); } \
  306.   NS_IMETHOD GetDefaultIntPref(const char *pref, PRInt32 *_retval) { return _to GetDefaultIntPref(pref, _retval); } \
  307.   NS_IMETHOD SetDefaultBoolPref(const char *pref, PRBool value) { return _to SetDefaultBoolPref(pref, value); } \
  308.   NS_IMETHOD SetDefaultCharPref(const char *pref, const char *value) { return _to SetDefaultCharPref(pref, value); } \
  309.   NS_IMETHOD SetDefaultIntPref(const char *pref, PRInt32 value) { return _to SetDefaultIntPref(pref, value); } \
  310.   NS_IMETHOD CopyUnicharPref(const char *pref, PRUnichar **_retval) { return _to CopyUnicharPref(pref, _retval); } \
  311.   NS_IMETHOD CopyDefaultUnicharPref(const char *pref, PRUnichar **_retval) { return _to CopyDefaultUnicharPref(pref, _retval); } \
  312.   NS_IMETHOD SetUnicharPref(const char *pref, const PRUnichar *value) { return _to SetUnicharPref(pref, value); } \
  313.   NS_IMETHOD SetDefaultUnicharPref(const char *pref, const PRUnichar *value) { return _to SetDefaultUnicharPref(pref, value); } \
  314.   NS_IMETHOD GetLocalizedUnicharPref(const char *pref, PRUnichar **_retval) { return _to GetLocalizedUnicharPref(pref, _retval); } \
  315.   NS_IMETHOD GetDefaultLocalizedUnicharPref(const char *pref, PRUnichar **_retval) { return _to GetDefaultLocalizedUnicharPref(pref, _retval); } \
  316.   NS_IMETHOD GetFilePref(const char *pref, nsIFileSpec **_retval) { return _to GetFilePref(pref, _retval); } \
  317.   NS_IMETHOD SetFilePref(const char *pref, nsIFileSpec *value, PRBool setDefault) { return _to SetFilePref(pref, value, setDefault); } \
  318.   NS_IMETHOD GetFileXPref(const char *pref, nsILocalFile **_retval) { return _to GetFileXPref(pref, _retval); } \
  319.   NS_IMETHOD SetFileXPref(const char *pref, nsILocalFile *value) { return _to SetFileXPref(pref, value); } \
  320.   NS_IMETHOD RegisterCallback(const char *domain, PrefChangedFunc callback, void * closure) { return _to RegisterCallback(domain, callback, closure); } \
  321.   NS_IMETHOD UnregisterCallback(const char *domain, PrefChangedFunc callback, void * closure) { return _to UnregisterCallback(domain, callback, closure); } \
  322.   NS_IMETHOD EnumerateChildren(const char *parent, PrefEnumerationFunc callback, void * data) { return _to EnumerateChildren(parent, callback, data); } 
  323.  
  324. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  325. #define NS_FORWARD_SAFE_NSIPREF(_to) \
  326.   NS_IMETHOD ReadUserPrefs(nsIFile *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadUserPrefs(aFile); } \
  327.   NS_IMETHOD ResetPrefs(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetPrefs(); } \
  328.   NS_IMETHOD ResetUserPrefs(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetUserPrefs(); } \
  329.   NS_IMETHOD SavePrefFile(nsIFile *aFile) { return !_to ? NS_ERROR_NULL_POINTER : _to->SavePrefFile(aFile); } \
  330.   NS_IMETHOD GetBranch(const char *aPrefRoot, nsIPrefBranch **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBranch(aPrefRoot, _retval); } \
  331.   NS_IMETHOD GetDefaultBranch(const char *aPrefRoot, nsIPrefBranch **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultBranch(aPrefRoot, _retval); } \
  332.   NS_IMETHOD GetRoot(char * *aRoot) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRoot(aRoot); } \
  333.   NS_IMETHOD GetPrefType(const char *aPrefName, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPrefType(aPrefName, _retval); } \
  334.   NS_IMETHOD GetBoolPref(const char *aPrefName, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBoolPref(aPrefName, _retval); } \
  335.   NS_IMETHOD SetBoolPref(const char *aPrefName, PRInt32 aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetBoolPref(aPrefName, aValue); } \
  336.   NS_IMETHOD GetCharPref(const char *aPrefName, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharPref(aPrefName, _retval); } \
  337.   NS_IMETHOD SetCharPref(const char *aPrefName, const char *aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCharPref(aPrefName, aValue); } \
  338.   NS_IMETHOD GetIntPref(const char *aPrefName, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIntPref(aPrefName, _retval); } \
  339.   NS_IMETHOD SetIntPref(const char *aPrefName, PRInt32 aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetIntPref(aPrefName, aValue); } \
  340.   NS_IMETHOD GetComplexValue(const char *aPrefName, const nsIID & aType, void * *aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetComplexValue(aPrefName, aType, aValue); } \
  341.   NS_IMETHOD SetComplexValue(const char *aPrefName, const nsIID & aType, nsISupports *aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetComplexValue(aPrefName, aType, aValue); } \
  342.   NS_IMETHOD ClearUserPref(const char *aPrefName) { return !_to ? NS_ERROR_NULL_POINTER : _to->ClearUserPref(aPrefName); } \
  343.   NS_IMETHOD PrefIsLocked(const char *aPrefName, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->PrefIsLocked(aPrefName, _retval); } \
  344.   NS_IMETHOD LockPref(const char *aPrefName) { return !_to ? NS_ERROR_NULL_POINTER : _to->LockPref(aPrefName); } \
  345.   NS_IMETHOD UnlockPref(const char *aPrefName) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnlockPref(aPrefName); } \
  346.   NS_IMETHOD ResetBranch(const char *aStartingAt) { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetBranch(aStartingAt); } \
  347.   NS_IMETHOD DeleteBranch(const char *aStartingAt) { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteBranch(aStartingAt); } \
  348.   NS_IMETHOD GetChildList(const char *aStartingAt, PRUint32 *aCount, char ***aChildArray) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChildList(aStartingAt, aCount, aChildArray); } \
  349.   NS_IMETHOD AddObserver(const char *aDomain, nsIObserver *aObserver, PRBool aHoldWeak) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(aDomain, aObserver, aHoldWeak); } \
  350.   NS_IMETHOD RemoveObserver(const char *aDomain, nsIObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(aDomain, aObserver); } \
  351.   NS_IMETHOD CopyCharPref(const char *pref, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CopyCharPref(pref, _retval); } \
  352.   NS_IMETHOD CopyDefaultCharPref(const char *pref, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CopyDefaultCharPref(pref, _retval); } \
  353.   NS_IMETHOD GetDefaultBoolPref(const char *pref, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultBoolPref(pref, _retval); } \
  354.   NS_IMETHOD GetDefaultIntPref(const char *pref, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultIntPref(pref, _retval); } \
  355.   NS_IMETHOD SetDefaultBoolPref(const char *pref, PRBool value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultBoolPref(pref, value); } \
  356.   NS_IMETHOD SetDefaultCharPref(const char *pref, const char *value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultCharPref(pref, value); } \
  357.   NS_IMETHOD SetDefaultIntPref(const char *pref, PRInt32 value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultIntPref(pref, value); } \
  358.   NS_IMETHOD CopyUnicharPref(const char *pref, PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CopyUnicharPref(pref, _retval); } \
  359.   NS_IMETHOD CopyDefaultUnicharPref(const char *pref, PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CopyDefaultUnicharPref(pref, _retval); } \
  360.   NS_IMETHOD SetUnicharPref(const char *pref, const PRUnichar *value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUnicharPref(pref, value); } \
  361.   NS_IMETHOD SetDefaultUnicharPref(const char *pref, const PRUnichar *value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDefaultUnicharPref(pref, value); } \
  362.   NS_IMETHOD GetLocalizedUnicharPref(const char *pref, PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLocalizedUnicharPref(pref, _retval); } \
  363.   NS_IMETHOD GetDefaultLocalizedUnicharPref(const char *pref, PRUnichar **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultLocalizedUnicharPref(pref, _retval); } \
  364.   NS_IMETHOD GetFilePref(const char *pref, nsIFileSpec **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFilePref(pref, _retval); } \
  365.   NS_IMETHOD SetFilePref(const char *pref, nsIFileSpec *value, PRBool setDefault) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFilePref(pref, value, setDefault); } \
  366.   NS_IMETHOD GetFileXPref(const char *pref, nsILocalFile **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFileXPref(pref, _retval); } \
  367.   NS_IMETHOD SetFileXPref(const char *pref, nsILocalFile *value) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFileXPref(pref, value); } \
  368.   NS_IMETHOD RegisterCallback(const char *domain, PrefChangedFunc callback, void * closure) { return !_to ? NS_ERROR_NULL_POINTER : _to->RegisterCallback(domain, callback, closure); } \
  369.   NS_IMETHOD UnregisterCallback(const char *domain, PrefChangedFunc callback, void * closure) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnregisterCallback(domain, callback, closure); } \
  370.   NS_IMETHOD EnumerateChildren(const char *parent, PrefEnumerationFunc callback, void * data) { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateChildren(parent, callback, data); } 
  371.  
  372. #if 0
  373. /* Use the code below as a template for the implementation class for this interface. */
  374.  
  375. /* Header file */
  376. class nsPref : public nsIPref
  377. {
  378. public:
  379.   NS_DECL_ISUPPORTS
  380.   NS_DECL_NSIPREF
  381.  
  382.   nsPref();
  383.  
  384. private:
  385.   ~nsPref();
  386.  
  387. protected:
  388.   /* additional members */
  389. };
  390.  
  391. /* Implementation file */
  392. NS_IMPL_ISUPPORTS1(nsPref, nsIPref)
  393.  
  394. nsPref::nsPref()
  395. {
  396.   /* member initializers and constructor code */
  397. }
  398.  
  399. nsPref::~nsPref()
  400. {
  401.   /* destructor code */
  402. }
  403.  
  404. /* void readUserPrefs (in nsIFile aFile); */
  405. NS_IMETHODIMP nsPref::ReadUserPrefs(nsIFile *aFile)
  406. {
  407.     return NS_ERROR_NOT_IMPLEMENTED;
  408. }
  409.  
  410. /* void ResetPrefs (); */
  411. NS_IMETHODIMP nsPref::ResetPrefs()
  412. {
  413.     return NS_ERROR_NOT_IMPLEMENTED;
  414. }
  415.  
  416. /* void ResetUserPrefs (); */
  417. NS_IMETHODIMP nsPref::ResetUserPrefs()
  418. {
  419.     return NS_ERROR_NOT_IMPLEMENTED;
  420. }
  421.  
  422. /* void savePrefFile (in nsIFile aFile); */
  423. NS_IMETHODIMP nsPref::SavePrefFile(nsIFile *aFile)
  424. {
  425.     return NS_ERROR_NOT_IMPLEMENTED;
  426. }
  427.  
  428. /* nsIPrefBranch getBranch (in string aPrefRoot); */
  429. NS_IMETHODIMP nsPref::GetBranch(const char *aPrefRoot, nsIPrefBranch **_retval)
  430. {
  431.     return NS_ERROR_NOT_IMPLEMENTED;
  432. }
  433.  
  434. /* nsIPrefBranch getDefaultBranch (in string aPrefRoot); */
  435. NS_IMETHODIMP nsPref::GetDefaultBranch(const char *aPrefRoot, nsIPrefBranch **_retval)
  436. {
  437.     return NS_ERROR_NOT_IMPLEMENTED;
  438. }
  439.  
  440. /* readonly attribute string root; */
  441. NS_IMETHODIMP nsPref::GetRoot(char * *aRoot)
  442. {
  443.     return NS_ERROR_NOT_IMPLEMENTED;
  444. }
  445.  
  446. /* long GetPrefType (in string aPrefName); */
  447. NS_IMETHODIMP nsPref::GetPrefType(const char *aPrefName, PRInt32 *_retval)
  448. {
  449.     return NS_ERROR_NOT_IMPLEMENTED;
  450. }
  451.  
  452. /* boolean GetBoolPref (in string aPrefName); */
  453. NS_IMETHODIMP nsPref::GetBoolPref(const char *aPrefName, PRBool *_retval)
  454. {
  455.     return NS_ERROR_NOT_IMPLEMENTED;
  456. }
  457.  
  458. /* void SetBoolPref (in string aPrefName, in long aValue); */
  459. NS_IMETHODIMP nsPref::SetBoolPref(const char *aPrefName, PRInt32 aValue)
  460. {
  461.     return NS_ERROR_NOT_IMPLEMENTED;
  462. }
  463.  
  464. /* string GetCharPref (in string aPrefName); */
  465. NS_IMETHODIMP nsPref::GetCharPref(const char *aPrefName, char **_retval)
  466. {
  467.     return NS_ERROR_NOT_IMPLEMENTED;
  468. }
  469.  
  470. /* void SetCharPref (in string aPrefName, in string aValue); */
  471. NS_IMETHODIMP nsPref::SetCharPref(const char *aPrefName, const char *aValue)
  472. {
  473.     return NS_ERROR_NOT_IMPLEMENTED;
  474. }
  475.  
  476. /* long GetIntPref (in string aPrefName); */
  477. NS_IMETHODIMP nsPref::GetIntPref(const char *aPrefName, PRInt32 *_retval)
  478. {
  479.     return NS_ERROR_NOT_IMPLEMENTED;
  480. }
  481.  
  482. /* void SetIntPref (in string aPrefName, in long aValue); */
  483. NS_IMETHODIMP nsPref::SetIntPref(const char *aPrefName, PRInt32 aValue)
  484. {
  485.     return NS_ERROR_NOT_IMPLEMENTED;
  486. }
  487.  
  488. /* void getComplexValue (in string aPrefName, in nsIIDRef aType, [iid_is (aType), retval] out nsQIResult aValue); */
  489. NS_IMETHODIMP nsPref::GetComplexValue(const char *aPrefName, const nsIID & aType, void * *aValue)
  490. {
  491.     return NS_ERROR_NOT_IMPLEMENTED;
  492. }
  493.  
  494. /* void setComplexValue (in string aPrefName, in nsIIDRef aType, in nsISupports aValue); */
  495. NS_IMETHODIMP nsPref::SetComplexValue(const char *aPrefName, const nsIID & aType, nsISupports *aValue)
  496. {
  497.     return NS_ERROR_NOT_IMPLEMENTED;
  498. }
  499.  
  500. /* void ClearUserPref (in string aPrefName); */
  501. NS_IMETHODIMP nsPref::ClearUserPref(const char *aPrefName)
  502. {
  503.     return NS_ERROR_NOT_IMPLEMENTED;
  504. }
  505.  
  506. /* boolean PrefIsLocked (in string aPrefName); */
  507. NS_IMETHODIMP nsPref::PrefIsLocked(const char *aPrefName, PRBool *_retval)
  508. {
  509.     return NS_ERROR_NOT_IMPLEMENTED;
  510. }
  511.  
  512. /* void lockPref (in string aPrefName); */
  513. NS_IMETHODIMP nsPref::LockPref(const char *aPrefName)
  514. {
  515.     return NS_ERROR_NOT_IMPLEMENTED;
  516. }
  517.  
  518. /* void unlockPref (in string aPrefName); */
  519. NS_IMETHODIMP nsPref::UnlockPref(const char *aPrefName)
  520. {
  521.     return NS_ERROR_NOT_IMPLEMENTED;
  522. }
  523.  
  524. /* void resetBranch (in string aStartingAt); */
  525. NS_IMETHODIMP nsPref::ResetBranch(const char *aStartingAt)
  526. {
  527.     return NS_ERROR_NOT_IMPLEMENTED;
  528. }
  529.  
  530. /* void DeleteBranch (in string aStartingAt); */
  531. NS_IMETHODIMP nsPref::DeleteBranch(const char *aStartingAt)
  532. {
  533.     return NS_ERROR_NOT_IMPLEMENTED;
  534. }
  535.  
  536. /* void getChildList (in string aStartingAt, out unsigned long aCount, [array, size_is (aCount), retval] out string aChildArray); */
  537. NS_IMETHODIMP nsPref::GetChildList(const char *aStartingAt, PRUint32 *aCount, char ***aChildArray)
  538. {
  539.     return NS_ERROR_NOT_IMPLEMENTED;
  540. }
  541.  
  542. /* void addObserver (in string aDomain, in nsIObserver aObserver, in boolean aHoldWeak); */
  543. NS_IMETHODIMP nsPref::AddObserver(const char *aDomain, nsIObserver *aObserver, PRBool aHoldWeak)
  544. {
  545.     return NS_ERROR_NOT_IMPLEMENTED;
  546. }
  547.  
  548. /* void removeObserver (in string aDomain, in nsIObserver aObserver); */
  549. NS_IMETHODIMP nsPref::RemoveObserver(const char *aDomain, nsIObserver *aObserver)
  550. {
  551.     return NS_ERROR_NOT_IMPLEMENTED;
  552. }
  553.  
  554. /* string CopyCharPref (in string pref); */
  555. NS_IMETHODIMP nsPref::CopyCharPref(const char *pref, char **_retval)
  556. {
  557.     return NS_ERROR_NOT_IMPLEMENTED;
  558. }
  559.  
  560. /* string CopyDefaultCharPref (in string pref); */
  561. NS_IMETHODIMP nsPref::CopyDefaultCharPref(const char *pref, char **_retval)
  562. {
  563.     return NS_ERROR_NOT_IMPLEMENTED;
  564. }
  565.  
  566. /* boolean GetDefaultBoolPref (in string pref); */
  567. NS_IMETHODIMP nsPref::GetDefaultBoolPref(const char *pref, PRBool *_retval)
  568. {
  569.     return NS_ERROR_NOT_IMPLEMENTED;
  570. }
  571.  
  572. /* long GetDefaultIntPref (in string pref); */
  573. NS_IMETHODIMP nsPref::GetDefaultIntPref(const char *pref, PRInt32 *_retval)
  574. {
  575.     return NS_ERROR_NOT_IMPLEMENTED;
  576. }
  577.  
  578. /* void SetDefaultBoolPref (in string pref, in boolean value); */
  579. NS_IMETHODIMP nsPref::SetDefaultBoolPref(const char *pref, PRBool value)
  580. {
  581.     return NS_ERROR_NOT_IMPLEMENTED;
  582. }
  583.  
  584. /* void SetDefaultCharPref (in string pref, in string value); */
  585. NS_IMETHODIMP nsPref::SetDefaultCharPref(const char *pref, const char *value)
  586. {
  587.     return NS_ERROR_NOT_IMPLEMENTED;
  588. }
  589.  
  590. /* void SetDefaultIntPref (in string pref, in long value); */
  591. NS_IMETHODIMP nsPref::SetDefaultIntPref(const char *pref, PRInt32 value)
  592. {
  593.     return NS_ERROR_NOT_IMPLEMENTED;
  594. }
  595.  
  596. /* wstring CopyUnicharPref (in string pref); */
  597. NS_IMETHODIMP nsPref::CopyUnicharPref(const char *pref, PRUnichar **_retval)
  598. {
  599.     return NS_ERROR_NOT_IMPLEMENTED;
  600. }
  601.  
  602. /* wstring CopyDefaultUnicharPref (in string pref); */
  603. NS_IMETHODIMP nsPref::CopyDefaultUnicharPref(const char *pref, PRUnichar **_retval)
  604. {
  605.     return NS_ERROR_NOT_IMPLEMENTED;
  606. }
  607.  
  608. /* void SetUnicharPref (in string pref, in wstring value); */
  609. NS_IMETHODIMP nsPref::SetUnicharPref(const char *pref, const PRUnichar *value)
  610. {
  611.     return NS_ERROR_NOT_IMPLEMENTED;
  612. }
  613.  
  614. /* void SetDefaultUnicharPref (in string pref, in wstring value); */
  615. NS_IMETHODIMP nsPref::SetDefaultUnicharPref(const char *pref, const PRUnichar *value)
  616. {
  617.     return NS_ERROR_NOT_IMPLEMENTED;
  618. }
  619.  
  620. /* wstring getLocalizedUnicharPref (in string pref); */
  621. NS_IMETHODIMP nsPref::GetLocalizedUnicharPref(const char *pref, PRUnichar **_retval)
  622. {
  623.     return NS_ERROR_NOT_IMPLEMENTED;
  624. }
  625.  
  626. /* wstring getDefaultLocalizedUnicharPref (in string pref); */
  627. NS_IMETHODIMP nsPref::GetDefaultLocalizedUnicharPref(const char *pref, PRUnichar **_retval)
  628. {
  629.     return NS_ERROR_NOT_IMPLEMENTED;
  630. }
  631.  
  632. /* nsIFileSpec GetFilePref (in string pref); */
  633. NS_IMETHODIMP nsPref::GetFilePref(const char *pref, nsIFileSpec **_retval)
  634. {
  635.     return NS_ERROR_NOT_IMPLEMENTED;
  636. }
  637.  
  638. /* void SetFilePref (in string pref, in nsIFileSpec value, in boolean setDefault); */
  639. NS_IMETHODIMP nsPref::SetFilePref(const char *pref, nsIFileSpec *value, PRBool setDefault)
  640. {
  641.     return NS_ERROR_NOT_IMPLEMENTED;
  642. }
  643.  
  644. /* nsILocalFile getFileXPref (in string pref); */
  645. NS_IMETHODIMP nsPref::GetFileXPref(const char *pref, nsILocalFile **_retval)
  646. {
  647.     return NS_ERROR_NOT_IMPLEMENTED;
  648. }
  649.  
  650. /* void setFileXPref (in string pref, in nsILocalFile value); */
  651. NS_IMETHODIMP nsPref::SetFileXPref(const char *pref, nsILocalFile *value)
  652. {
  653.     return NS_ERROR_NOT_IMPLEMENTED;
  654. }
  655.  
  656. /* [noscript] void RegisterCallback (in string domain, in PrefChangedFunc callback, in voidPtr closure); */
  657. NS_IMETHODIMP nsPref::RegisterCallback(const char *domain, PrefChangedFunc callback, void * closure)
  658. {
  659.     return NS_ERROR_NOT_IMPLEMENTED;
  660. }
  661.  
  662. /* [noscript] void UnregisterCallback (in string domain, in PrefChangedFunc callback, in voidPtr closure); */
  663. NS_IMETHODIMP nsPref::UnregisterCallback(const char *domain, PrefChangedFunc callback, void * closure)
  664. {
  665.     return NS_ERROR_NOT_IMPLEMENTED;
  666. }
  667.  
  668. /* [noscript] void EnumerateChildren (in string parent, in PrefEnumerationFunc callback, in voidPtr data); */
  669. NS_IMETHODIMP nsPref::EnumerateChildren(const char *parent, PrefEnumerationFunc callback, void * data)
  670. {
  671.     return NS_ERROR_NOT_IMPLEMENTED;
  672. }
  673.  
  674. /* End of implementation class template. */
  675. #endif
  676.  
  677.  
  678. #endif /* __gen_nsIPref_h__ */
  679.